/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2025/4/24
 * Time: 22:55
 */

#include "ObjectWorld.h"
#include "Scene.h"

void ObjectWorld::Init()
{
    ObjectScreen::Init();
    type_ = ObjectType::OBJECT_WORLD;
}

void ObjectWorld::Update(float _dt)
{
    ObjectScreen::Update(_dt);
    render_position_ = game_.GetCurrentScene()->WorldToScreen(position_);
}

void ObjectWorld::SetPosition(const glm::vec2 & _position)
{
    position_        = _position;
    render_position_ = game_.GetCurrentScene()->WorldToScreen(position_);
}

void ObjectWorld::TakeDamage(float _damage)
{
    return;
}

void ObjectWorld::SetRenderPosition(const glm::vec2 & _render_position)
{
    render_position_ = _render_position;
    position_        = game_.GetCurrentScene()->WorldToScreen(_render_position);
    ObjectScreen::SetRenderPosition(_render_position);
}